package com.es.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author:左泽林
 * @date:日期:2021-08-29-时间:20:12
 * @message:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
/*@Document(indexName = "product",shards = 3,replicas = 1)*/
@Document(indexName = "product")
public class Product {
    @Id
    private Long id;//商品唯一标识
    @Field(type = FieldType.Text)
    private String title;//商品名称
    @Field(type = FieldType.Keyword)
    private String category;//分类名称
    @Field(type = FieldType.Double)
    private Double price;//商品价格
    @Field(type = FieldType.Keyword,index = false) //index = false表示不做索引关联
    private String images;//图片地址

}
